package org.jeecg.modules.wmhb.service;

import org.jeecg.modules.wmhb.entity.WmContract;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.wmhb.entity.WmProject;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Description: 合同表
 * @Author: jeecg-boot
 * @Date:   2024-09-02
 * @Version: V1.0
 */
public interface IWmContractService extends IService<WmContract> {
    /**
     * 检查合同编码是否唯一
     * @param wmContract
     * @return
     */
    public String checkCodeUnique(WmContract wmContract);

    /**
     * 检查合同名称是否唯一
     * @param wmContract
     * @return
     */
    public String checkNameUnique(WmContract wmContract);

    /**
     * 检查合同下是否有任务书
     * @param id
     * @return
     */
    public boolean checkHasItem(String id);

    /**
     * 查询项目合同列表(非草稿状态)
     */
    public List<WmContract> queryGantContractByWmProjectId(String wmProjectId);

    /**
     * 已确认过的合同列表(非草稿状态)
     */
    public List<WmContract> confirmedContractList();

    /**
     * 通过关键字搜索
     */
    public List<WmContract> searchByName(String searchKey);

    /**
     * 通过项目ID和关键字搜索
     */
    public List<WmContract> searchByProjectAndName(String wmProjectId, String searchKey);

    /**
     * 搜索合同列表
     */
    public List<WmContract> listBySearch(WmContract wmContract);

    /**
     * 导出合同清单
     * @param request
     * @param wmContractList
     * @return
     */
    public ModelAndView exportContractExcel(HttpServletRequest request, List<WmContract> wmContractList);

    /**
     * 通过批次号查询合同
     */
    public WmContract queryByBachNo(String batchNo);

    /**
     * 项目合同列表
     */
    public List<WmContract> listByProject(WmProject wmProject);

    /**
     * 执行合同将合同产品最小销售单位生成计划
     * @param wmContract
     */
    public void executeContract(WmContract wmContract);
}
